package com.aceitunaproject.server.map;

import java.awt.Point;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

import com.aceitunaproject.server.map.MapTile;
import com.sun.sgs.app.ManagedObject;


/**
 * World map manager interface for handling map-related operations
 * 
 * @author Maciej Miechowicz
 */
public interface MapManager  extends ManagedObject,Serializable  {

	
	
	/**
	 * @return the mapType
	 */
	public MapType getMapType();

	/**
	 * @param mapType the mapType to set
	 */
	public void setMapType(MapType mapType); 
	
	/**
	 * returns the map tile in a map point
	 * @param the position of the tile to return
	 * @return the map tile
	 */
	MapTile getTile(Point position);

	/**
	 * returns the map tile in an given x, y coordinate
	 * @param x the x coordinate of the tile
	 * @param y the y coordinate of the tile
	 * @return the map tile
	 */
	MapTile getTile(int x, int y);
	
	/**
	 * 
	 * @return a list of all the tiles in the world map
	 */
	LinkedList<MapTile> getAllTiles();
	
	
	
	/**
	 * 
	 * Creates an empty world map of the specified dimensions
	 */
	
	void createWorldMap(int xDim, int yDim);
	
	/**
	 * Gets the list of adjacent map tiles to a given tile
	 * @param tile the tile whose adjacent map tiles will be returned
	 * @return the list of adjacent map tiles to a given tile
	 * @throws Exception 
	 */
	List<MapTile> getAdjacentTiles(MapTile tile) ;

	/**
	 * returns the maximum number of installations that can be built iun a given map tile.
	 * @param tile the tile to consider
	 * @return the maximum number of installations that can be built iun a given map tile.
	 */
	public long getInstallationLimit(MapTile tile);
}
